package encapsulation;

/**
 * @classname:Rectangle
 * @description:
 * @author: Mr.Z
 * @date: 2020/11/27 22:28
 * @version: 0.1
 * @since:1.8
 */
public class Rectangle {
    private double high;
    private double wide;
    public Rectangle() {
        this.high = 20.0;
        this.wide = 10.0;
    }
    public Rectangle(double high, double wide) {
        this.high = high;
        this.wide = wide;
    }

    public double getHigh() {
        return high;
    }

    public void setHigh(double high) {
        this.high = high;
    }

    public double getWide() {
        return wide;
    }

    public void setWide(double wide) {
        this.wide = wide;
    }
    public double perimeter(double high,double wide){
        return (high+wide)*2;
    }
    public double area(double high,double wide){
        return high*wide;
    }

    public static void main(String[] args) {
        Rectangle re = new Rectangle();
        System.out.println(re.area(20,10));
        System.out.println(re.perimeter(30,20));
    }
}
